<!--{include common_head}-->

<div class="login_con">
		<div class="date clearfix">
			<span>本日の日期：</span>
			<b>${date('Y')}</b>
			<em>年</em>
			<b>${date('m')}</b>
			<em>月</em>
			<b>${date('d')}</b>
			<em>日</em>

		</div>
		<form action="/search.php" method="get" name="searchForm">
		<div class="login_inp">
			<ul>
				<li class="login_1 clearfix">
					<label>日付選択：</label>
					<input type="text" class="Wdate" onfocus="WdatePicker({lang:'jp', minDate:'${date('Y-m-d')}'})" value='{$year}-${sprintf("%02d",$month)}-${sprintf("%02d",$day)}' name="search_date" />
					<a class="data_icon" href="javascript:;"></a>
				</li>
				<li class="login_2 clearfix">
					<label>店舗選択：</label>
					<input type="text" value="サービスサービススサービスサービスサービス" readonly="readonly" targetname="shop_id"/>
					<a class="drop_icon" href="javascript:;" targetname="shop_id"></a>
					<ul class="drop_menu_m">
						${Utility::OptionLi($shopList, 'id', $defaultShopId, 'shop_name')}
					</ul>
					<input type="hidden" name="shop_id" value="{$defaultShopId}"/>
				</li>
				<li class="login_3 clearfix">
					<label>サービス選択：</label>
					<input type="text" value="サービスサービススサービスサービスサービス"  readonly="readonly" targetname="service_id"/>
					<a class="drop_icon" href="javascript:;" targetname="service_id"></a>
					<ul class="drop_menu_m">
						${Utility::OptionLi($serviceList, 'id', $serviceId, 'service_name')}
					</ul>
					<input type="hidden" name="service_id" value="{$serviceId}"/>
				</li>
			</ul>
		</div>
		
		<div class="search_area clearfix"><a class="sear_btn" href="#nogo" onClick="document.searchForm.submit()"/></a></div>
		</form>
		<div class="order clearfix">
			<div class="order_left">

				<p>{$service['service_name']}</p>
				<p>予約可能な時間</p>
				<p class="clock clearfix">
				  <!--{if $forenoonTime==null}-->
		          <span>午前予約終了です</span><br>
		          <!--{/if}--> 
		          <!--{if $forenoonTime!=null}-->
		          <span>午前：${date("Y年m月d日 H:i", $forenoonTime['start'])}</span><br>
		          <!--{/if}--> 
		          <!--{if $afternoonTime==null}-->
		          <span>午後予約終了です</span><br>
		          <!--{/if}--> 
		          <!--{if $afternoonTime!=null}-->
		          <span>午後：${date("Y年m月d日 H:i", $afternoonTime['start'])}</span><br>
		          <!--{/if}--> 
		           <!--{if $eveningTime==null}-->
		          <span>夕方予約終了です</span><br>
		          <!--{/if}--> 
		          <!--{if $eveningTime!=null}-->
		          <span>夕方：${date("Y年m月d日 H:i", $eveningTime['start'])}</span><br>
		          <!--{/if}--> 
				</p>
			</div>
			<div class="order_right">
				<a href="/preengage.php" class="order_time"></a>
			</div>

		</div>
	</div>
</div>
</body>
</html>

<script type="text/javascript">
jQuery(function(){
	$(".login_2").children(".drop_menu_m").find("a").bind("click", function(){
		$shopId = $("input[name='shop_id']");
		//console("aa");
		if( $(this).attr("value") < 1 ){
			return ;
		}
		//$shopId.val($(this).attr("val"));
		
		$.get("{$webRoot}/ajax/GetServiceList.php", "shopId=" + $shopId.val(), function(data){
			$(".login_3").children(".drop_menu_m").find("a").unbind("click");
			
			$("input[name='service_id']").val(0);
			var lis = '';
			for(var index in data.data){
				if( !index ){
					continue;
				}
				lis = lis + '<li><a href="javascript:;" value="' + index + '">' + data.data[index].service_name + '</a></li>';
			}
			$(".login_3").children(".drop_menu_m").prevAll("input").val("選択してください");
			$(".login_3").children(".drop_menu_m").html(lis);
			bindli($(".login_3").children(".drop_menu_m"));
		}, "json");
		
	});
});
</script>
</html>